package com.winchain.chainbill.receivables.biz.impt.rx;

import com.winchain.chainbill.receivables.base.po.ArRecord;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class BatchReceivablesStats {
	private int affectedRows;
	private Map<String, BigDecimal> assets;
	private List<ArRecord> abnormalRecord;
	private List<String> abnormalMsg;

	public int getAffectedRows() {
		return this.affectedRows;
	}

	public void setAffectedRows(int affectedRows) {
		this.affectedRows = affectedRows;
	}

	public int addAffectedRows() {
		return ++this.affectedRows;
	}

	public Map<String, BigDecimal> getAssets() {
		return this.assets;
	}

	public void setAssets(Map<String, BigDecimal> assets) {
		this.assets = assets;
	}

	public void addPassedRecord(ArRecord record) {
		if (this.assets == null) {
			this.assets = new HashMap();
		}
		addAffectedRows();
		String key = record.getSellerId();
		BigDecimal cm = record.getCreditMoney();
		BigDecimal value = (BigDecimal) this.assets.get(key);
		if (value == null) {
			value = new BigDecimal(0);
		}
		value = value.add(cm);
		this.assets.put(key, value);
	}

	public void addAbnormalRecord(ArRecord record) {
		if (this.abnormalRecord == null) {
			this.abnormalRecord = new ArrayList();
		}
		this.abnormalRecord.add(record);
	}

	public void addAbnormalMsg(String msg) {
		if (this.abnormalMsg == null) {
			this.abnormalMsg = new ArrayList();
		}
		this.abnormalMsg.add(msg);
	}

	public List<ArRecord> getAbnormalRecord() {
		return this.abnormalRecord;
	}

	public void setAbnormalRecord(List<ArRecord> abnormalRecord) {
		this.abnormalRecord = abnormalRecord;
	}

	public List<String> getAbnormalMsg() {
		return this.abnormalMsg;
	}

	public void setAbnormalMsg(List<String> abnormalMsg) {
		this.abnormalMsg = abnormalMsg;
	}
}
